/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package knowledgebase.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author eugene
 */
@Entity
@Table(name = "ROLE_GLOBAL_PERMISSION")
public class RoleGlobalPermission implements Serializable {
    
    @Id
    @Column(name = "ROLE_GLOBAL_PERMISIION_ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;
    
    @ManyToOne
    @JoinColumn(name = "ROLE_ID")
    private Role role;
    
    @ManyToOne
    @JoinColumn(name = "ACCESS_TYPE_ID")
    private AccessType accessType;

    public RoleGlobalPermission() {
    }

    public RoleGlobalPermission(long id, Role role, AccessType accessType) {
        this.id = id;
        this.role = role;
        this.accessType = accessType;
    }

    public void setAccessType(AccessType accessType) {
        this.accessType = accessType;
    }

    public void setId(long id) {
        this.id = id;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    public AccessType getAccessType() {
        return accessType;
    }

    public long getId() {
        return id;
    }

    public Role getRole() {
        return role;
    }
    
}
